﻿<phone:PhoneApplicationPage 
    x:Class="Qplus.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:my="clr-namespace:Qplus"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:UI="clr-namespace:Qplus.UI">

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" >
        <Grid.Resources>
            <UI:FriendControl x:Key="fc"/>
        </Grid.Resources>
        <Grid.Background>
            <ImageBrush ImageSource="/Qplus;component/Pic/hostbg.jpg" Stretch="UniformToFill" />
        </Grid.Background>
        <my:ButtonEx x:Name="enterBtn" Width="114" Height="116"  BorderThickness="0" InvisibleMargin="0" 
                     HorizontalAlignment="Right" VerticalAlignment="Top"
                     RenderTransformOrigin="1 1"
                     ManipulationStarted="enterBtn_ManipulationStarted"
                     ManipulationDelta="enterBtn_ManipulationDelta"
                     ManipulationCompleted="enterBtn_ManipulationCompleted">
            <my:ButtonEx.RenderTransform>
                <CompositeTransform></CompositeTransform>
            </my:ButtonEx.RenderTransform>
            <my:ButtonEx.Background>
                <ImageBrush ImageSource="/Qplus;component/Pic/qplusbtn.png" Stretch="None" />
            </my:ButtonEx.Background>
            <my:ButtonEx.PressedBackground>
                <ImageBrush ImageSource="/Qplus;component/Pic/qplusbtn.png" Stretch="None" />
            </my:ButtonEx.PressedBackground>
        </my:ButtonEx>
        <ItemsControl  x:Name="itemsControl" Visibility="Collapsed" Background="#B28BB2F1" HorizontalAlignment="Center" VerticalAlignment="Center">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Border Padding="3">
                        <toolkit:WrapPanel>
                            <CheckBox  Content="{Binding txt}"/>
                        </toolkit:WrapPanel>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        <ListBox x:Name="flist" Visibility="Collapsed" DataContext="{Binding fc,Mode=TwoWay}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel></toolkit:WrapPanel>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <UI:FriendControl/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Visibility="Collapsed" Content="123" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="Button_Click" />
        <ProgressBar Name="waitBar" Background="Green"
                     IsIndeterminate="True" Height="50" VerticalAlignment="Bottom"
                     Visibility="Collapsed" BorderBrush="#FFC72EBB" Foreground="#FF2D85BA" OpacityMask="#FF2323C1" BorderThickness="20" />
        <Button Content="Button" Height="72" HorizontalAlignment="Left" Margin="160,323,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />
    </Grid>
    
    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>